<?php

(!defined('IN_TOA') || !defined('IN_ADMIN')) && exit('Access Denied!');
/*
	[天生创想] (C)2008-2011 515158 Inc.
	This is NOT a freeware, use is subject to license terms
    URL:http://www.515158.com/
*/

get_config_keytable("config_db_old");

empty($do) && $do = 'list';
//初使化数据库
$dbhost = DB_HOST;		// 数据库服务器
$dbuser = DB_USER;			// 数据库用户名
$dbpwd = DB_PWD;				// 数据库密码
$dbname = DB_NAME;		// 数据库名
include("include/dbbackup.class.php");
include("include/msg.class.php");
$dbbackup = new dbbackup($dbhost, $dbuser, $dbpwd, $dbname);
$msg = new msg();
$bakfile = $dbbackup->get_backup();
if ($do == 'list') {

include_once('template/data_import.php');
} elseif ($do == 'save') {
if($dbbackup->import($_GET['fn'])){				//导入数据
			//$str = "恭喜您<br>备份数据已经成功导入！";					//提示信息
			//$msg->show_msg($str,'import.php','export.php');			//提示导入成功
			goto_page('admin.php?ac=data_import&fileurl=config&message=1');
		}
		

} 
elseif ($do == '删 除') {
echo $dbbackup->del($_POST['choice'])? goto_page('admin.php?ac=data_import&fileurl=config&message=1'): goto_page('admin.php?ac=data_import&fileurl=config&message=2');

} 
?>